//
//  DefineConstrant.h
//  mendianjieke
//
//  Created by 响当当 on 7/30/19.
//  Copyright © 2019 dongzheng. All rights reserved.
//


#define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)
#define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)
#define TABBAR_HEIGHT (STATUSBAR_HEIGHT > 20 ? 83.0f : 49.0f)
#define NAVIBAR_HEIGHT (IS_OS_7_Later ? (IS_INCH_X || IS_INCH_MAX || IS_INCH_XR) ? 88.0f : 64.0f : 44.0f)
#define STATUSBAR_HEIGHT [UIApplication sharedApplication].statusBarFrame.size.height

//适配
#define kUIScaleBasePlus [UIScreen mainScreen].bounds.size.width/375.0

//尺寸
#define IS_INCH_3_5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? \
CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) : NO)

#define IS_INCH_4   ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? \
CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)

#define IS_INCH_4_7  ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? \
CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) : NO)

#define IS_INCH_5_5   ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? \
CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size) : NO)

#define IS_INCH_X ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)

#define IS_INCH_XR ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(828, 1792), [[UIScreen mainScreen] currentMode].size) : NO)

#define IS_INCH_MAX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2688), [[UIScreen mainScreen] currentMode].size) : NO)

//***系统版本相关***//
#define IS_OS_7_Later ([[[UIDevice currentDevice] systemVersion] doubleValue] >= 7.0)

#define LCHexColor(hexValue) [UIColor colorWithRed:(hexValue>>16)/255.0 green:(hexValue>>8&0xff)/255.0 blue:(hexValue&0xff)/255.0 alpha:1]
#define WeakSelf(type) __weak __typeof(&*self)weakSelf = self;

//字体大小
#define kMainTitleFont [UIFont boldSystemFontOfSize:16.5]
#define kDescTitleFont [UIFont systemFontOfSize:14]

//背景颜色
#define JSAMainColor LCHexColor(0xff4e00)
//#define JSAMainColor LCHexColor(0xF54337)
#define JSALineColor LCHexColor(0xEFEFEF)
#define JSAMainBgColor LCHexColor(0xffffff)


#define DISMISS_SVP(time) \
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(time * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ \
[SVProgressHUD dismiss]; \
});


//cleartview里的设置
#define kFontOfSize(fontSize) [UIFont fontWithName:@"STHeitiSC-Light" size:fontSize]
#define kFontOfSizeBold(fontSize) [UIFont fontWithName:@"STHeitiSC-Medium" size:fontSize]
#define kFontOfSizeBolds(fontSize)  [UIFont fontWithName:@"Helvetica-Bold" size:fontSize]

//Table中栏位名称
#define kColorCellTitle [UIColor colorWithRed:33/255.0 green:33/255.0 blue:33/255.0 alpha:1.0]
//Table中栏位内容
#define kColorCellDetail [UIColor colorWithRed:112/255.0 green:112/255.0 blue:112/255.0 alpha:1.0]

#define kBtnOrange LCHexColor(0xFFA81B)


//本地数据库操作
#define lcDBOperation [LCFMDB shareDatabase]

//判断是否为空
#define IFNULL(a, b) (a == [NSNull null] || a == nil ? b : a)

//存储
#define LCUserDefaultsSet(value, key) [[NSUserDefaults standardUserDefaults] setValue:value forKey:key]
#define LCUserDefaultsGet(key) [[NSUserDefaults standardUserDefaults] valueForKey:key]
#define LCUserDefaultsSyn [[NSUserDefaults standardUserDefaults] synchronize]

#define VOICE [SoundControlSingle sharedInstanceForSound]
#define SHAKER [SoundControlSingle sharedInstanceForVibrate]


//当前登录用户
#define kLoginUser @"kLoginUser"

#define htoken @"8ba71364a0a2623e707bdcf50d71b814bd9d0bb61910220d96e8c2eca42e5192"



#define LCVersionKey @"AppVersion"

#define kKeyWindow          [UIApplication sharedApplication].keyWindow


//App版本号
#define appVersion [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]

/** 随机色 */
#define RANDOMCOLOR [UIColor colorWithRed:arc4random() % 256 / 255.0 green:arc4random() % 256 / 255.0 blue:arc4random() % 256 / 255.0 alpha:1]
/** 清除背景色 */
#define CLEARCOLOR [UIColor clearColor]
/** 主题色(00,CA,A3) */
#define ThemeColor LCHexColor(0x198DF0)
/** 白色(FF,FF,FF) */
#define WhiteColor [UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:1]
/**黄色(FC,BF,13)*/
#define YellowColor LCHexColor(0xF48B65)
/** 红色(EA,55,44) */
#define RedColor [UIColor colorWithRed:234/255.0 green:85/255.0 blue:68/255.0 alpha:1]
/** 蓝色(1E,88,E5) */
#define BlueColor [UIColor colorWithRed:30/255.0 green:136/255.0 blue:229/255.0 alpha:1]
/** 黑色(33,33,33) */
#define BlackColor [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1]
/** 灰色C3(C3,C3,C3) */
#define GrayHC3Color [UIColor colorWithRed:195/255.0 green:195/255.0 blue:195/255.0 alpha:1]
/** 灰色B(BB,BB,BB) */
#define GrayHBColor [UIColor colorWithRed:187/255.0 green:187/255.0 blue:187/255.0 alpha:1]
/** 文字灰色(66,66,66) */
#define GrayH6Color [UIColor colorWithRed:102/255.0 green:102/255.0 blue:102/255.0 alpha:1]
/** 文字灰色(99,99,99) */
#define GrayH9Color [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1]
/** 分割线颜色(DD,DD,DD) */
#define GrayLineColor [UIColor colorWithRed:221 / 254.0 green:221 / 254.0 blue:221 / 254.0 alpha:1]
/** 控制器背景颜色(EE,EE,EE) */
#define GrayVCColor [UIColor colorWithRed:238/255.0 green:238/255.0 blue:238/255.0 alpha:1]
/** 边框(CC,CC,CC) */
#define GrayFrameColor [UIColor colorWithRed:204/255.0 green:204/255.0 blue:204/255.0 alpha:1]

/** 12号字 */
#define TwelveTypeface [UIFont systemFontOfSize:12]
